DateCompare(date1, date2 [, datePart])


PerFORMs a full date/time comparison of two dates. Returns -1 if date1 is less than date2; returns 0 if date1 is equal to date2; returns 1 if date1 is greater than date2. See the description of datePart for information on specifying the precision of the comparison.

See also CreateDateTime and DatePart.

date1

Date/time object in the period from 100 AD to 9999 AD.

date2

Date/time object in the period from 100 AD to 9999 AD.

datePart

Optional. The precision of the comparison. This parameter can have any of the following values: